package com.csdj.sc.provider.config;



import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

public class MyBatisPlus {

    public static void main(String[] args) {
        String projectPath = System.getProperty("user.dir");
        FastAutoGenerator.create("jdbc:mysql://localhost:3306/springcloud","admin","123456")
                .globalConfig(builder ->{
                    builder.author("cloud")
                            .outputDir(projectPath);
                })
                .packageConfig(builder -> {
                    builder.parent("com.csdj.sc")
                            .entity("common.src.main.java.com.csdj.sc.common.entity")
                            .service("provider.src.main.java.com.csdj.sc.provider.service")
                            .serviceImpl("provider.src.main.java.com.csdj.sc.provider.service")
                            .xml("provider.src.main.java.com.csdj.sc.provider.mapper");

//                            .pathInfo(Collections.singletonMap(OutputFile.mapperXml,projectPath + "/src/main/java"));
                })
                .strategyConfig(builder -> {
                    builder.addInclude("user_login_record");
                })
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }
}
